#pragma once

#include <iostream>
#include <string>
#include <functional>

using namespace std;

#define         TEST_BINDANDFUNCTION                0

/**
 * @brief The Test class                    测试Test类调用TestAdd类中的方法(不在Test类中实例化TestAdd对象)
 * std::bind()      绑定类
 */
class Test
{
public:
    Test(){}

    void func(std::function<void(int, int)> fc, int a, int b)
    {
        fc(a, b);
    }
};

class TestAdd
{
public:
    TestAdd(){}

    void add(int a, int b)
    {
        std::cout << __PRETTY_FUNCTION__  << " | " << a << " + " << b << " = " << a+b << endl;
    }

    void mul(int a, int b)
    {
        std::cout << a << " - " << b << " = " << a-b << endl;
    }
};

void Add(int a, int b)
{
    std::cout << a << " + " << b << " = " << a+b << endl;
}

